package com.wisdom.model.dao;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.io.BufferedWriter;
import java.util.Date;

import org.hibernate.SessionFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

import com.wisdom.model.entities.User;

public class Test {
	public static void main (String[] a) throws IOException{
		ApplicationContext context = new FileSystemXmlApplicationContext("src/main/resources/app-config.xml");
		UserDao dao =  (UserDao)context.getBean("userDao");
				
		User user = new User();
		user.setName("Alex");
		user.setLogin("alex");
		user.setPassword("1988");
		user.setEmail("alexAkselrod@yandex.ru");
		user.setRegistrationDate(new Date());
		user.setEnterDate(new Date());
		dao.addUser(user);
		
	}
}
